import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:lib_uikit/widgets/gt_pop_menu_widget_v3.dart';
import 'package:lib_uikit/widgets/notification/gt_notification_widget_v3.dart';

class GTNotificationV3 {
  static Future<dynamic> showDialog(
    String title,
    String contentText, {
    Offset target = const Offset(0, 0),
  }) {
    return SmartDialog.showAttach(
      targetContext: null,
      targetBuilder: (_, __) => target,
      usePenetrate: true,
      animationType: SmartAnimationType.scale,
      alignment: Alignment.bottomCenter,
      tag: contentText,
      builder: (_) {
        return GTNotificationWidgetV3(
          title: title,
          content: contentText,
          onCloseClick: (){
            SmartDialog.dismiss(tag: contentText);
          },
        );
      },
    );
  }
}
